export function trimValid (rule, value, cb) {
  if (value && !value.trim()) {
    cb(new Error(name + this.__('不能为空')))
  } else {
    cb()
  }
}
export function urlValid (rule, value, cb) {
  var strRegex = /^((https|http|ftp|rtsp|mms)?:\/\/)+[A-Za-z0-9-_]+\.[A-Za-z0-9]+[\/=\?%\-&_~`@[\]\':+!]*([^<>\"\"])*$/
  var re = new RegExp(strRegex)
  if (!re.test(value)) {
    cb(new Error(rule.message))
  } else {
    cb()
  }
}
